package com.oto.model;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Text;

/**
 * @author xueqiang.mi
 * @since 2010-12-19
 */
@PersistenceCapable(table = "SharedData", identityType = IdentityType.APPLICATION)
public class SharedDataDO implements Serializable {
	private static final long serialVersionUID = 6631507427360181717L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private Text content;
	@Persistent
	private Date crtDate;

	public Text getContent() {
		return content;
	}

	public Date getCrtDate() {
		return crtDate;
	}

	public Long getId() {
		return id;
	}

	public void setContent(String content) {
		this.content = new Text(content);
	}

	public void setContent(Text content) {
		this.content = content;
	}

	public void setCrtDate(Date crtDate) {
		this.crtDate = crtDate;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public String toString() {
		return "SharedData [content=" + content + ", id=" + id + "]";
	}
}
